import 'package:flutter/material.dart';

class Chapter11Page extends StatelessWidget {
  const Chapter11Page({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("第十一章"),
        leading: IconButton(
          icon: const Icon(Icons.home),
          onPressed: () => Navigator.of(context).pushNamed("/"),
        ),
      ),
      body: SingleChildScrollView(
        child: Center(
          child: Column(
            children: <Widget>[
              const SizedBox(height: 20),
              ElevatedButton(
                onPressed: () => Navigator.of(context)
                    .pushNamed("/chapter11/file/operation"),
                child: const Text("文件操作"),
              ),
              const SizedBox(height: 20),
              ElevatedButton(
                onPressed: () =>
                    Navigator.of(context).pushNamed("/chapter11/http/test"),
                child: const Text("Http Client"),
              ),
              const SizedBox(height: 20),
              ElevatedButton(
                onPressed: () =>
                    Navigator.of(context).pushNamed("/chapter11/dio/test"),
                child: const Text("Dio Test"),
              ),
              const SizedBox(height: 20),
              ElevatedButton(
                onPressed: () => Navigator.of(context)
                    .pushNamed("/chapter11/web/socket/test"),
                child: const Text("WebSocket Test"),
              ),
              const SizedBox(height: 20),
              ElevatedButton(
                onPressed: () =>
                    Navigator.of(context).pushNamed("/chapter11/socket/test"),
                child: const Text("Socket Test"),
              ),
              const SizedBox(height: 20),
              ElevatedButton(
                onPressed: () =>
                    Navigator.of(context).pushNamed("/chapter11/json/test"),
                child: const Text("Json Test"),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
